[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 getaspectratio()        Get Current Graphics Mode's Aspect Ratio

 #include   <graphics.h>

 void far   getaspectratio(xasp,yasp);
 int far    *xasp;
 int far    *yasp;

    getaspectratio() gets the aspect ratio.  The ratio is not actually
    returned but can be calculated by dividing 'xasp' by 'yasp' for
    vertical correction or 'yasp' divided by 'xasp' for horizontal
    correction.  The aspect ratio is the scaling factor used by the
    graphics system to make symmetrical geometric objects come out
    symmetrical on the screen.

    Returns:    Nothing.

   -------------------------------- Example ---------------------------------

    The following statements draw a square on the screen.

           #include <graphics.h>
           #include <conio.h>

           main()
           {
               int gdriver = DETECT;
               int gmode;
               int xasp, yasp;
               long xlong;

               initgraph(&gdriver,&gmode,"");
               getaspectratio(&xasp,&yasp);
               xlong = (200L * (long)yasp)/(long)xasp;
               rectangle(100,100,(int)xlong,200);
               getch();
               closegraph();
           }


See Also: arc() circle() ellipse() getarccoords() pieslice()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson